<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>孕育宝典 - 我的收藏</title>
        <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
        <style>
            body {
                font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
                background-color: #f5f5f5;
                color: #333333;
                margin: 0;
                padding: 0;
            }
            .device-container {
                width: 390px;
                height: 844px;
                overflow: hidden;
                position: relative;
                background-color: #ffffff;
            }
            .status-bar {
                height: 44px;
                background-color: #ffffff;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0 20px;
                font-size: 14px;
                font-weight: 600;
            }
            .header {
                background-color: #ffffff;
                padding: 12px 16px 8px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1px solid #f0f0f0;
            }
            .nav-bar {
                height: 60px;
                background-color: #ffffff;
                position: absolute;
                bottom: 0;
                width: 100%;
                display: flex;
                justify-content: space-around;
                align-items: center;
                border-top: 1px solid #f0f0f0;
            }
            .nav-item {
                display: flex;
                flex-direction: column;
                align-items: center;
                color: #666666;
                font-size: 10px;
            }
            .nav-item.active {
                color: #ff9fb5;
            }
            .main-content {
                height: calc(844px - 44px - 60px - 56px);
                overflow-y: auto;
                padding: 16px;
                background-color: #f9f9f9;
            }
            .card {
                background-color: #ffffff;
                border-radius: 12px;
                padding: 16px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
                margin-bottom: 16px;
            }
            .card-title {
                font-size: 16px;
                font-weight: 600;
                color: #333;
                margin-bottom: 12px;
                display: flex;
                align-items: center;
            }
            .card-title i {
                margin-right: 8px;
                color: #ff9fb5;
            }
            .tabs {
                display: flex;
                background-color: #f5f5f5;
                border-radius: 8px;
                padding: 4px;
                margin-bottom: 16px;
            }
            .tab {
                flex: 1;
                text-align: center;
                padding: 8px 0;
                font-size: 14px;
                border-radius: 6px;
                cursor: pointer;
                transition: all 0.2s ease;
            }
            .tab.active {
                background-color: #fff;
                color: #ff9fb5;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            }
            .search-bar {
                display: flex;
                align-items: center;
                background-color: #f5f5f5;
                border-radius: 8px;
                padding: 8px 12px;
                margin-bottom: 16px;
            }
            .search-bar i {
                color: #999;
                margin-right: 8px;
            }
            .search-bar input {
                background-color: transparent;
                border: none;
                outline: none;
                flex: 1;
                font-size: 14px;
                color: #333;
            }
            .favorite-category {
                display: none;
            }
            .favorite-category.active {
                display: block;
            }
            .favorite-item {
                display: flex;
                padding: 12px 0;
                border-bottom: 1px solid #f0f0f0;
            }
            .favorite-item:last-child {
                border-bottom: none;
            }
            .favorite-thumbnail {
                width: 72px;
                height: 72px;
                border-radius: 8px;
                background-color: #f0f0f0;
                overflow: hidden;
                flex-shrink: 0;
                margin-right: 12px;
            }
            .favorite-thumbnail img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
            .favorite-content {
                flex: 1;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
            }
            .favorite-title {
                font-weight: 600;
                font-size: 15px;
                color: #333;
                line-height: 1.3;
                margin-bottom: 4px;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .favorite-description {
                font-size: 13px;
                color: #666;
                margin-bottom: 6px;
                display: -webkit-box;
                -webkit-line-clamp: 1;
                -webkit-box-orient: vertical;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .favorite-meta {
                display: flex;
                align-items: center;
                font-size: 12px;
                color: #999;
            }
            .favorite-tag {
                display: inline-block;
                padding: 2px 6px;
                background-color: #f5f5f5;
                color: #666;
                border-radius: 4px;
                font-size: 11px;
                margin-right: 8px;
            }
            .favorite-date {
                margin-left: auto;
            }
            .action-bar {
                display: flex;
                justify-content: space-between;
                padding: 12px 0;
                margin-bottom: 16px;
                border-bottom: 1px solid #f0f0f0;
            }
            .action-button {
                display: flex;
                align-items: center;
                color: #666;
                font-size: 14px;
            }
            .action-button i {
                margin-right: 4px;
            }
            .empty-state {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                padding: 40px 20px;
                text-align: center;
            }
            .empty-state-icon {
                font-size: 48px;
                color: #ddd;
                margin-bottom: 16px;
            }
            .empty-state-text {
                font-size: 15px;
                color: #999;
                margin-bottom: 20px;
            }
            .empty-state-button {
                padding: 8px 16px;
                background-color: #ff9fb5;
                color: white;
                border-radius: 6px;
                font-size: 14px;
            }
        </style>
    </head>
    <body>
        <div class="device-container">
            <!-- iOS状态栏 -->
            <div class="status-bar">
                <span>9:41</span>
                <div class="flex items-center">
                    <i class="fas fa-signal mr-1"></i>
                    <i class="fas fa-wifi mr-1"></i>
                    <i class="fas fa-battery-full"></i>
                </div>
            </div>

            <!-- 页面头部 -->
            <div class="header">
                <div class="flex items-center">
                    <i class="fas fa-arrow-left mr-4"></i>
                    <h1 class="text-lg font-medium">我的收藏</h1>
                </div>
                <div class="flex gap-3">
                    <i class="fas fa-ellipsis-vertical"></i>
                </div>
            </div>

            <!-- 主内容区 -->
            <div class="main-content">
                <!-- 搜索栏 -->
                <div class="search-bar">
                    <i class="fas fa-search"></i>
                    <input type="text" placeholder="搜索收藏内容" />
                </div>

                <!-- 分类标签 -->
                <div class="tabs">
                    <div class="tab active" data-target="all">全部</div>
                    <div class="tab" data-target="article">文章</div>
                    <div class="tab" data-target="recipe">食谱</div>
                    <div class="tab" data-target="product">好物</div>
                </div>

                <!-- 操作栏 -->
                <div class="action-bar">
                    <div class="action-button">
                        <i class="fas fa-sort"></i>
                        <span>按时间排序</span>
                    </div>
                    <div class="action-button">
                        <i class="fas fa-folder"></i>
                        <span>整理收藏</span>
                    </div>
                </div>

                <!-- 全部收藏 -->
                <div class="favorite-category active" id="all">
                    <!-- 收藏项目 1 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/200/200" alt="科学备孕指南" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">科学备孕指南：从饮食调理到心理准备</div>
                                <div class="favorite-description">详解备孕期间的健康调理方案，助你轻松迎接新生命。</div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">备孕知识</span>
                                <span class="favorite-date">2023.06.15</span>
                            </div>
                        </div>
                    </div>

                    <!-- 收藏项目 2 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/201/201" alt="孕期营养食谱" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">孕期营养食谱：一周七天均衡饮食计划</div>
                                <div class="favorite-description">
                                    为准妈妈提供全面的营养食谱，满足孕期各阶段的营养需求。
                                </div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">孕期食谱</span>
                                <span class="favorite-date">2023.06.10</span>
                            </div>
                        </div>
                    </div>

                    <!-- 收藏项目 3 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/202/202" alt="产后恢复指南" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">产后康复专家推荐：快速恢复身体机能的8项练习</div>
                                <div class="favorite-description">
                                    科学有效的产后恢复指南，让新妈妈尽快恢复身体健康。
                                </div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">产后恢复</span>
                                <span class="favorite-date">2023.05.28</span>
                            </div>
                        </div>
                    </div>

                    <!-- 收藏项目 4 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/203/203" alt="婴儿护理用品" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">新生儿必备用品清单：精选10款高性价比护理产品</div>
                                <div class="favorite-description">为新手父母整理的婴儿护理产品推荐，让育儿更轻松。</div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">育儿好物</span>
                                <span class="favorite-date">2023.05.20</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 空收藏状态展示区 -->
                <div class="favorite-category" id="empty-state">
                    <div class="empty-state">
                        <div class="empty-state-icon">
                            <i class="fas fa-bookmark"></i>
                        </div>
                        <div class="empty-state-text">暂无收藏内容</div>
                        <div class="empty-state-button">去发现新内容</div>
                    </div>
                </div>

                <!-- 文章收藏 -->
                <div class="favorite-category" id="article">
                    <!-- 收藏项目 1 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/200/200" alt="科学备孕指南" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">科学备孕指南：从饮食调理到心理准备</div>
                                <div class="favorite-description">详解备孕期间的健康调理方案，助你轻松迎接新生命。</div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">备孕知识</span>
                                <span class="favorite-date">2023.06.15</span>
                            </div>
                        </div>
                    </div>

                    <!-- 收藏项目 3 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/202/202" alt="产后恢复指南" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">产后康复专家推荐：快速恢复身体机能的8项练习</div>
                                <div class="favorite-description">
                                    科学有效的产后恢复指南，让新妈妈尽快恢复身体健康。
                                </div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">产后恢复</span>
                                <span class="favorite-date">2023.05.28</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 食谱收藏 -->
                <div class="favorite-category" id="recipe">
                    <!-- 收藏项目 2 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/201/201" alt="孕期营养食谱" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">孕期营养食谱：一周七天均衡饮食计划</div>
                                <div class="favorite-description">
                                    为准妈妈提供全面的营养食谱，满足孕期各阶段的营养需求。
                                </div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">孕期食谱</span>
                                <span class="favorite-date">2023.06.10</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 好物收藏 -->
                <div class="favorite-category" id="product">
                    <!-- 收藏项目 4 -->
                    <div class="favorite-item">
                        <div class="favorite-thumbnail">
                            <img src="https://placekitten.com/203/203" alt="婴儿护理用品" />
                        </div>
                        <div class="favorite-content">
                            <div>
                                <div class="favorite-title">新生儿必备用品清单：精选10款高性价比护理产品</div>
                                <div class="favorite-description">为新手父母整理的婴儿护理产品推荐，让育儿更轻松。</div>
                            </div>
                            <div class="favorite-meta">
                                <span class="favorite-tag">育儿好物</span>
                                <span class="favorite-date">2023.05.20</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 底部导航栏 -->
            <div class="nav-bar">
                <div class="nav-item">
                    <i class="fas fa-home text-xl mb-1"></i>
                    <span>首页</span>
                </div>
                <div class="nav-item">
                    <i class="fas fa-calendar-alt text-xl mb-1"></i>
                    <span>日历</span>
                </div>
                <div class="nav-item">
                    <i class="fas fa-book-medical text-xl mb-1"></i>
                    <span>知识库</span>
                </div>
                <div class="nav-item active">
                    <i class="fas fa-user text-xl mb-1"></i>
                    <span>我的</span>
                </div>
            </div>
        </div>

        <script>
            document.addEventListener('DOMContentLoaded', function () {
                // 标签切换
                const tabs = document.querySelectorAll('.tab');
                tabs.forEach((tab) => {
                    tab.addEventListener('click', function () {
                        // 移除所有active类
                        tabs.forEach((t) => t.classList.remove('active'));
                        // 给当前点击的tab添加active类
                        this.classList.add('active');

                        // 显示对应的收藏类别内容
                        const target = this.getAttribute('data-target');
                        const categories = document.querySelectorAll('.favorite-category');
                        categories.forEach((category) => {
                            category.classList.remove('active');
                        });
                        document.getElementById(target).classList.add('active');
                    });
                });

                // 收藏项目点击事件
                const favoriteItems = document.querySelectorAll('.favorite-item');
                favoriteItems.forEach((item) => {
                    item.addEventListener('click', function () {
                        // 模拟点击跳转到详情页
                        console.log('查看收藏详情');
                    });
                });

                // 搜索功能
                const searchInput = document.querySelector('.search-bar input');
                searchInput.addEventListener('input', function () {
                    const searchText = this.value.toLowerCase();
                    const items = document.querySelectorAll('.favorite-item');

                    items.forEach((item) => {
                        const title = item.querySelector('.favorite-title').textContent.toLowerCase();
                        const description = item.querySelector('.favorite-description').textContent.toLowerCase();

                        if (title.includes(searchText) || description.includes(searchText)) {
                            item.style.display = 'flex';
                        } else {
                            item.style.display = 'none';
                        }
                    });
                });

                // 操作按钮事件
                const actionButtons = document.querySelectorAll('.action-button');
                actionButtons.forEach((button) => {
                    button.addEventListener('click', function () {
                        // 模拟操作功能
                        const action = this.querySelector('span').textContent;
                        console.log(`执行操作: ${action}`);
                    });
                });
            });
        </script>
    </body>
</html>
